/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package publicprivatestaticfinal;

/**
 *
 * @author parallels
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        displayKTE();
        
        ClientBean client1 = new ClientBean();
        ClientBean client2 = new ClientBean(2,"cliente 2");
        ClientBean client3 = new ClientBean(3,"cliente 3");
        
        System.out.println (MyConstant.PROJECT_LABEL);
        System.out.println (client1.getClientName());
        System.out.println (client2.getClientName());
        System.out.println (client3.getClientName());
        
        // Otra forma
        //-----------
        ClientBean [] list = new ClientBean[4];
        list[0] = client1;
        list[1] = client2;
        list[2] = client3;
        
        method1(list);
        method2(list);
        method3(list);
        
        System.out.println ("dias de la semana : " + MyConstant.DIAS_SEMANA );
    }
    
    private static void displayKTE () {
        System.out.println (" ");
        System.out.println("Fecha de proceso : " + MyConstant.KTE_DATE);
        System.out.println("Fecha de proceso : " + MyConstant.KTE_DATE_YMD);
        System.out.println ("KTE_LEIDA : " + MyConstant.KTE_LEIDA);
    }
    
    private static void method1(ClientBean [] list) {
        System.out.println (" ");
        System.out.println (MyConstant.PROJECT_LABEL);
        for (int i=0; i<3; ++i) {
            System.out.println("cliente : " + list[i].getClientName());
        }       
    }
    
    private static void method2(ClientBean [] list) {
        System.out.println (" ");
        System.out.println (MyConstant.PROJECT_LABEL);
        System.out.println ("largo de lista : " + list.length);
        
        for (int i=0; i<list.length; ++i) {
            if (list[i] != null) {
                System.out.println("cliente : " + i + list[i].getClientName());
            }
        }       
    }
    
    private static void method3(ClientBean [] list) {
        System.out.println (" ");
        System.out.println (MyConstant.PROJECT_LABEL);
        for (ClientBean client: list) {
            if (client != null) {
                System.out.println("cliente : " + client.getClientName());
            }
        }
    }
    
}
